package comday05.itheima03;

public class Demo11 {
    public static void main(String[] args) {
        int[] arr = {11,22,33};
        getSum(arr);


    }


    //定义方法，求一个数组的元素和
    public static void getSum(int[] arr){
        int sum = 0;
        for (int i = 0; i < arr.length; i++) {
            sum += arr[i];
        }
        System.out.println(sum);
    }
}
